all : cotehaus test

objects = types.o composer.o lgwseq.o java7.tab.o parse_file.o map_list.o header.o proto_id.o str_id.o type_id.o type_list.o unresolved_type.o class_def.o method_id.o

cotehaus : $(objects)
	bash build_wtname.sh
	gcc -Wall -g -std=c99 -lz -lpolarssl -o cotehaus $(objects)
	
test_objects = lgwseq_test.o str_id_test.o
	
test : cotehaus.o $(objects) $(test_objects)
	 gcc -Wall -g -std=c99 -lz -lpolarssl -o tests_harness cotehaus.o $(objects) $(test_objects)

%.tab.o: %.tab.c %.tab.h
%.tab.c %.tab.h: %.y
	bison -d --report=all $<

types.o: types.h
composer.o: composer.h

debian_install_zlib : 
	sudo apt install zlib1g-dev

debian_install_polarssl :
	sudo apt install libpolarssl-dev

stub_base_lib :
	bash scandoc.sh

vpath %.c src/main src/test
vpath %.h src/main src/test
vpath %.y src/main src/test
